# 请在此输入您的代码
n, k = map(int, input().split())
chol = []
for _ in range(n):
    ocho = list(map(int, input().split()))
    chol.append(ocho)


def check(num):
    # 判断能否分成这么大
    # 找到能这样分的巧克力
    could_cave = []
    for c in chol:
        if num <= min(c):
            could_cave.append(c)
    result = 0
    for c in could_cave:
        height = c[0] // num
        width = c[1] // num
        result += height * width
    return result >= k


left = 1
right = int(1e8)
ans = right
while left <= right:
    mid = (left + right) // 2
    if check(mid):
        ans = mid
        left = mid + 1
    else:
        right = mid - 1
print(ans)
